//
//  MyInfoViewController.m
//  MusicPlayer
//
//  Created by dlios on 15-5-25.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "MyInfoViewController.h"
#import "myButton.h"
#import "MySongViewController.h"
#import "DownSongViewController.h"
#import "LoveViewController.h"
#import "ListViewController.h"
#import "FavioutMvViewController.h"

@interface MyInfoViewController ()
@property (nonatomic, retain) UIButton *button;

@end

@implementation MyInfoViewController
- (void)dealloc
{
    [_button release];
    [super dealloc];
}

- (instancetype)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.navigationItem.title = @"我的信息";
        [self.view setBackgroundColor:[UIColor whiteColor]];
    }
    return self;
}

- (void)loadView
{
    [super loadView];
    
    UIImageView * imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    [imageView setImage:[UIImage imageNamed:@"back.jpg"]];
    [self.view addSubview:imageView];
    
    [self creatButton];
    
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    UIBarButtonItem *exits = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"back.png"] style:UIBarButtonItemStyleDone target:self action:@selector(exitsAction:)];
    self.navigationItem.leftBarButtonItem = exits;
    
}

#pragma mark - 返回图片的事件
- (void)exitsAction:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)creatButton
{
//    myButton * aButton = [[myButton alloc]initWithFrame:CGRectMake(60, 70, 100, 100)];
//    [aButton setTitle:@"我的歌曲" forState:UIControlStateNormal];
//    [aButton.imageview setImage:[UIImage imageNamed:@"default_list.png"]];
//    [aButton addTarget:self action:@selector(aButton:) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:aButton];
//    [aButton release];
//    
//    myButton * bButton = [[myButton alloc]initWithFrame:CGRectMake(215, 70, 100, 100)];
//    [bButton setTitle:@"下载歌曲" forState:UIControlStateNormal];
//    [bButton.imageview setImage:[UIImage imageNamed:@"downloading_list@2x.png"]];
//    [bButton addTarget:self action:@selector(bButton:) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:bButton];
//    [bButton release];
//    
    myButton * cButton = [[myButton alloc]initWithFrame:CGRectMake(self.view.frame.size.width/375*200, self.view.frame.size.height/667*90, self.view.frame.size.width/375*120,self.view.frame.size.height/667* 120)];
    [cButton setTitle:@"最爱歌曲" forState:UIControlStateNormal];
    [cButton.imageview setImage:[UIImage imageNamed:@"wocang.png"]];
    [cButton addTarget:self action:@selector(cButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:cButton];
    [cButton release];
    
//    myButton * dButton = [[myButton alloc]initWithFrame:CGRectMake(60, 180, 100, 100)];
//    [dButton setTitle:@"最近播放" forState:UIControlStateNormal];
//    [dButton.imageview setImage:[UIImage imageNamed:@"favored@2x.png"]];
//    [dButton addTarget:self action:@selector(dButton:) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:dButton];
//    [dButton release];
    
    myButton *mv = [[myButton alloc] initWithFrame:CGRectMake(self.view.frame.size.width/375*30,self.view.frame.size.height/667*90, self.view.frame.size.width/375*120,self.view.frame.size.height/667* 120)];
    [mv setTitle:@"热门MV" forState:UIControlStateNormal];
    [mv.imageview setImage:[UIImage imageNamed:@"rmv.png"]];
    [mv addTarget:self action:@selector(mvAction:) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:mv];
    [mv release];
    
}


- (void)mvAction:(id)sender
{
    FavioutMvViewController *mv = [[FavioutMvViewController alloc] init];
    [self.navigationController pushViewController:mv animated:YES];
}


-(void)aButton:(id)sender
{
    MySongViewController * mysong = [[MySongViewController alloc]init];
    [self.navigationController pushViewController:mysong animated:YES];
}

-(void)bButton:(id)sender
{
    DownSongViewController * down = [[DownSongViewController alloc]init];
    [self.navigationController pushViewController:down animated:YES];
}

-(void)cButton:(id)sender
{
    LoveViewController * love =[[LoveViewController alloc]init];
    [self.navigationController pushViewController:love animated:YES];
}

-(void)dButton:(id)sender
{
    ListViewController * list = [[ListViewController alloc]init];
    [self.navigationController pushViewController:list animated:YES];
}


@end
